package com.lucy.nepu.module.property.utils;

import cn.dev33.satoken.stp.StpUtil;
import com.lucy.nepu.module.paper.params.PaperCreateParams;
import com.lucy.nepu.module.property.params.PropertyCreateParams;

public class PropertyUtil {
    public static String formValid(PropertyCreateParams params){
        // 表单重复性校验
        String errMsg = "";
        Long operator = StpUtil.getLoginIdAsLong();
        Long applyId = params.getSecondAuthorId();
        if (!params.getFirstAuthorId().equals(0L)) {
            applyId = params.getFirstAuthorId();
        }
        if (!applyId.equals(operator)){
            errMsg = "您不是负责人，无法申报该项目";
            return errMsg;
        }
        return errMsg;
    }
}
